﻿/* System.Compute: a Computation Framework for .NET/Mono
 * Copyright (C) 2011 Ralf "raboni" Boeckhorst
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 3 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General
 * Public License along with this library; if not, write to the
 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
 * Boston, MA 02110-1301 USA
 */

namespace System.Compute.OpenCL
{
    public enum ErrorCode : int
    {
        Success = 0,
        DeviceNotFound = -1,
        DeviceNotAvailable = -2,
        CompilerNotAvailable = -3,
        MemObjectAllocationFailure = -4,
        OutOfResources = -5,
        OutOfHostMemory = -6,
        ProfilingInfoNotAvailable = -7,
        MemCopyOverlap = -8,
        ImageFormatMismatch = -9,
        ImageFormatNotSupported = -10,
        BuildProgramFailure = -11,
        MapFailure = -12,
        InvalidValue = -30,
        InvalidDeviceType = -31,
        InvalidPlatform = -32,
        InvalidDevice = -33,
        InvalidContext = -34,
        InvalidQueueProperties = -35,
        InvalidCommandQueue = -36,
        InvalidHostPtr = -37,
        InvalidMemObject = -38,
        InvalidImageFormatDescriptor = -39,
        InvalidImageSize = -40,
        InvalidSampler = -41,
        InvalidBinary = -42,
        InvalidBuildOptions = -43,
        InvalidProgram = -44,
        InvalidProgramExecutable = -45,
        InvalidKernelName = -46,
        InvalidKernelDefinition = -47,
        InvalidKernel = -48,
        InvalidArgIndex = -49,
        InvalidArgValue = -50,
        InvalidArgSize = -51,
        InvalidKernelArgs = -52,
        InvalidWorkDimension = -53,
        InvalidWorkGroupSize = -54,
        InvalidWorkItemSize = -55,
        InvalidGlobalOffset = -56,
        InvalidEventWaitList = -57,
        InvalidEvent = -58,
        InvalidOperation = -59,
        InvalidGLObject = -60,
        InvalidBufferSize = -61,
        InvalidMipLevel = -62,
        InvalidGlobalWorkSize = -63
    }

    internal enum PlatformInfo : int
    {
        Profile = 2304,
        Version = 2305,
        Name = 2306,
        Vendor = 2307,
        Extensions = 2308
    }

    public enum DeviceType : long
    {
        Default = 1,
        CPU = 2,
        GPU = 4,
        Accelerator = 8,
        Custom = 16,
        All = 4294967295
    }

    internal enum DeviceInfo : int
    {
        AddressBits = 4109,
        Available = 4135,
        BuiltInKernel = 4159,
        CompilerAvailable = 4136,
        DoubleFPConfig = 4146,
        DriverVersion = 4141,
        EndianLittle = 4134,
        ErrorCorrectionSupport = 4132,
        ExecutionCapabilities = 4137,
        Extensions = 4144,
        GlobalMemCacheSize = 4126,
        GlobalMemCacheType = 4124,
        GlobalMemCachelineSize = 4125,
        GlobalMemSize = 4127,
        HalfFPConfig = 4147,
        HostUnifiedMemory = 4149,
        ImageSupport = 4118,
        Image2DMaxHeight = 4114,
        Image2DMaxWidth = 4113,
        Image3DMaxDepth = 4117,
        Image3DMaxHeight = 4116,
        Image3DMaxWidth = 4115,
        ImageMaxBufferSize = 4160,
        ImageMaxArraySize = 4161,
        LinkerAvailable = 4158,
        LocalMemSize = 4131,
        LocalMemType = 4130,
        MaxClockFrequency = 4108,
        MaxComputeUnits = 4098,
        MaxConstantArgs = 4129,
        MaxConstantBufferSize = 4128,
        MaxMemAllocSize = 4112,
        MaxParameterSize = 4119,
        MaxReadImageArgs = 4110,
        MaxSamplers = 4120,
        MaxSubDevices = 4163,
        MaxWorkGroupSize = 4100,
        MaxWorkItemDimensions = 4099,
        MaxWorkItemSizes = 4101,
        MaxWriteImageArgs = 4111,
        MemBaseAddrAlign = 4121,
        MinDataTypeAlignSize = 4122,
        Name = 4139,
        NativeVectorWidthChar = 4150,
        NativeVectorWidthShort = 4151,
        NativeVectorWidthInt = 4152,
        NativeVectorWidthLong = 4153,
        NativeVectorWidthFloat = 4154,
        NativeVectorWidthDouble = 4155,
        NativeVectorWidthHalf = 4156,
        OpenCLCVersion = 4157,
        ParentDevice = 4162,
        PartitionMaxSubDevices = 4163,
        Platform = 4145,
        PreferredVectorWidthChar = 4102,
        PreferredVectorWidthShort = 4103,
        PreferredVectorWidthInt = 4104,
        PreferredVectorWidthLong = 4105,
        PreferredVectorWidthFloat = 4106,
        PreferredVectorWidthDouble = 4107,
        PreferredVectorWidthHalf = 4148,
        Profile = 4142,
        ProfilingTimerResolution = 4133,
        QueueProperties = 4138,
        SingleFPConfig = 4123,
        Type = 4096,
        Vendor = 4140,
        VendorId = 4097,
        Version = 4143,
        PartitionProperties = 4164,
        PartitionAffinityDomain = 4165,
        PartitionType = 4166,
        PrintFBufferSize = 4169,
        PreferredInteropUserSync = 4168
    }

    public enum DeviceFPConfig : long
    {
        Denorm = 1,
        InfNAN = 2,
        RoundToNearest = 4,
        RoundToZero = 8,
        RoundToInf = 16,
        FMA = 32
    }

    public enum DeviceExecutionCapabilities : long
    {
        Kernel = 1,
        NativeKernel = 2
    }

    public enum DeviceMemCacheType : long
    {
        None = 0,
        ReadOnlyCache = 1,
        ReadWriteCache = 2
    }

    public enum DeviceLocalMemType : long
    {
        Local = 1,
        Global = 2
    }

    public enum DevicePartitionProperty : int
    {
        Equally = 4230,
        ByCounts = 4231,
        ByAffinityDomain = 4232,
        ByCountsListEnd = 0
    }

    public enum DeviceAffinityDomain : long
    {
        NUMA = 1,
        L4Cache = 2,
        L3Cache = 4,
        L2Cache = 8,
        L1Cache = 16,
        NextPartitionable = 32
    }

    public enum CommandQueueInfo : int
    {
        Context = 4240,
        Device = 4241,
        ReferenceCount = 4242,
        Properties = 4243
    }

    public enum CommandQueueProperties : long
    {
        OutOfOrderExecModeEnable = 1,
        ProfilingEnable = 2
    }

    internal enum ContextProperties : int
    {
        Platform = 4228
    }

    internal enum ContextInfo : int
    {
        ReferenceCount = 4224,
        Devices = 4225,
        Properties = 4226,
        NumDevices = 4227
    }

    public enum MemoryFlags : long
    {
        ReadWrite = 1,
        WriteOnly = 2,
        ReadOnly = 4,
        //UseHostPtr = 8,
        //AllocHostPtr = 16,
        //CopyHostPtr = 32
    }

    internal enum EventInfo : int
    {
        CommandQueue = 4560,
        CommandType = 4561,
        CommandExecutionStatus = 4563,
        ReferenceCount = 4562
    }

    public enum CommandType : int
    {
        NDRangeKernel = 4592,
        Task = 4593,
        NativeKernel = 4594,
        ReadBuffer = 4595,
        WriteBuffer = 4596,
        CopyBuffer = 4597,
        ReadImage = 4598,
        WriteImage = 4599,
        CopyImage = 4600,
        CopyImageToBuffer = 4601,
        CopyBufferToImage = 4602,
        MapBuffer = 4603,
        MapImage = 4604,
        UnmapMemObject = 4605,
        Marker = 4606,
        AcquireGLObjects = 4607,
        ReleaseGLObjects = 4608
    }

    public enum CommandExecutionStatus : int
    {
        Complete = 0,
        Running = 1,
        Submitted = 2,
        Queued = 3
    }

    internal enum ProfilingInfo : int
    {
        CommandQueued = 4736,
        CommandSubmit = 4737,
        CommandStart = 4738,
        CommandEnd = 4739
    }

    internal enum ProgramInfo : int
    {
        ReferenceCount = 4448,
        Context = 4449,
        NumDevices = 4450,
        Devices = 4451,
        Source = 4452,
        BinarySizes = 4453,
        Binaries = 4454,
        NumKernels = 4455,
        KernelNames = 4456
    }

    internal enum ProgramBuildInfo : int
    {
        Status = 4481,
        Options = 4482,
        Log = 4483,
        BinaryType = 4484
    }

    public enum BuildStatus : int
    {
        Success = 0,
        None = -1,
        Error = -2,
        InProgress = -3
    }

    public enum ProgramBinaryType : long
    {
        None = 0,
        CompiledObject = 1,
        Library = 2,
        Executable = 4
    }

    internal enum KernelInfo : int
    {
        FunctionName = 4496,
        NumArgs = 4497,
        ReferenceCount = 4498,
        Context = 4499,
        Program = 4500,
        Attributes = 4501
    }

    internal enum KernelWorkGroupInfo : int
    {
        Size = 4528,
        CompileSize = 4529,
        LocalMemSize = 4530,
        PreferredWorkGroupSizeMultiple = 4531,
        PrivateMemSize = 4532
    }

    internal enum MemoryObjectInfo : int
    {
        Type = 4352,
        Flags = 4353,
        Size = 4354,
        HostPtr = 4355,
        MapCount = 4356,
        ReferenceCount = 4357,
        Context = 4358,
        AssociatedMemoryBuffer = 4359,
        Offset = 4360
    }

    public enum MemoryObjectType : int
    {
        Buffer = 4336,
        Image2D = 4337,
        Image3D = 4338
    }

    public enum UserEventStatus : int
    {
        Complete = 0,
        Error = -1
    }

    public enum ChannelOrder : int
    {
        R = 4272,
        A = 4273,
        RG = 4274,
        RA = 4275,
        RGB = 4276,
        RGBA = 4277,
        BGRA = 4278,
        ARGB = 4279,
        Intensity = 4280,
        Luminance = 4281
    }

    public enum ChannelType : int
    {
        SNORM_INT8 = 4304,
        SNORM_INT16 = 4305,
        UNORM_INT8 = 4306,
        UNORM_INT16 = 4307,
        UNORM_SHORT_565 = 4308,
        UNORM_SHORT_555 = 4309,
        UNORM_INT_101010 = 4310,
        SIGNED_INT8 = 4311,
        SIGNED_INT16 = 4312,
        SIGNED_INT32 = 4313,
        UNSIGNED_INT8 = 4314,
        UNSIGNED_INT16 = 4315,
        UNSIGNED_INT32 = 4316,
        HALF_FLOAT = 4317,
        FLOAT = 4318
    }

    public enum ImageInfo : int
    {
        Format = 4368,
        ElementSize = 4369,
        RowPitch = 4370,
        SlicePitch = 4371,
        Width = 4372,
        Height = 4373,
        Depth = 4374
    }

    public enum MapFlags : long
    {
        Read = 1,
        Write = 2
    }

    public enum AddressingMode : int
    {
        None = 4400,
        ClampToEdge = 4401,
        Clamp = 4402,
        Repeat = 4403
    }

    public enum FilterMode : int
    {
        Nearest = 4416,
        Linear = 4417
    }

    public enum SamplerInfo : int
    {
        ReferenceCount = 4432,
        Context = 4433,
        NormalizedCoords = 4434,
        AddressingMode = 4435,
        FilterMode = 4436
    }
}